package com.learn.xiaoha.sqlsession.ProxyMapper;

import com.learn.xiaoha.sqlsession.SqlSession;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;

import javax.sql.DataSource;
import java.lang.reflect.Proxy;

/**
 * ProxyMapperUtils
 * 产生代理对象
 * @author: cyx_jay
 * @date: 2021/2/2 14:18
 */
public class ProxyMapper {


    /**
     * 产生代理对象
     */
    public<T> T getProxyMapper(Class<T> t){

        ClassLoader classLoader = this.getClass().getClassLoader();
        Class[] classes = {t};
        T o = (T) Proxy.newProxyInstance(classLoader, classes, new SimpleMapperHandle());

        return o;
    }




}
